home *** CD-ROM | disk | FTP | other *** search
/ Freelog 115 / FreelogNo115-MaiJuin2013.iso / Internet / Filezilla Server / FileZilla_Server-0_9_41.exe / source / xml_utils.cpp < prev    next >
C/C++ Source or Header  |  2011-11-06  |  487b  |  24 lines

  1. #include "StdAfx.h"
  2. #include "xml_utils.h"
  3. #include "conversion.h"
  4. #include "tinyxml/tinyxml.h"
  5.  
  6. namespace XML
  7. {
  8.  
  9. CStdString ReadText(TiXmlElement* pElement)
  10. {
  11.     TiXmlNode* textNode = pElement->FirstChild();
  12.     if (!textNode || !textNode->ToText())
  13.         return _T("");
  14.  
  15.     return ConvFromNetwork(textNode->Value());                    
  16. }
  17.  
  18. void SetText(TiXmlElement* pElement, const CStdString& text)
  19. {
  20.     pElement->Clear();
  21.     pElement->LinkEndChild(new TiXmlText(ConvToNetwork(text)));
  22. }
  23.  
  24. }